package ControlLayer;
import ModelLayer.Order;
import ModelLayer.OrderDetail;
import ModelLayer.OrderDiscount;
import ModelLayer.OrderHistory;
import ModelLayer.OrderState;
import ModelLayer.Address;
import ModelLayer.Country;
import ModelLayer.Customer;
import DBLayer.DBOrder;
import DBLayer.DBOrderDetail;
import DBLayer.DBOrderDiscount;
import DBLayer.DBOrderHistory;
import DBLayer.DBOrderState;
import DBLayer.DBAddress;
import DBLayer.DBCountry;
import DBLayer.DBCustomer;
import java.util.ArrayList;

public class CtrShowOrder {
    // <editor-fold defaultstate="collapsed" desc="Attributes & Constructors">
    private static CtrShowOrder instance = null;
    DBOrder dbOrder = new DBOrder();
    DBOrderDetail dbOrderDetail = new DBOrderDetail();
    DBOrderDiscount dbOrderDiscount = new DBOrderDiscount();
    DBOrderHistory dbOrderHistory = new DBOrderHistory();
    DBOrderState dbOrderState = new DBOrderState();
    DBAddress dbAddress = new DBAddress();
    DBCountry dbCountry = new DBCountry();
    DBCustomer dbCustomer = new DBCustomer();

    public CtrShowOrder() {
    }
    // </editor-fold>

    // <editor-fold defaultstate="collapsed" desc="Methods">
    public static CtrShowOrder getInstance() {
        if (instance == null) {
            instance = new CtrShowOrder();
        }
        return instance;
    }

    public ArrayList<Order> getOrderList() {
        return dbOrder.getOrderList();
    }

    public Order getOrderByID(int id) {
        return dbOrder.getOrderByID(id);
    }

    public ArrayList<OrderDetail> getOrderDetailListByOrderID(int id) {
        return dbOrderDetail.getOrderDetailListByOrderID(id);
    }
    public Address getAddressByID(int id) {
        return dbAddress.getAddressByID(id);
    }

    public Country getCountryByID(int id) {
        return dbCountry.getCountryByID(id);
    }

    public Customer getCustomerByID(int id) {
        return dbCustomer.getCustomerByID(id);
    }
    // </editor-fold>
}
